//
//  ZZFForgetVC.m
//  Pods
//
//  Created by quheng on 2017/8/29.
//
//

#import "BZUCForgetVC.h"
#import "BZUCForgetWrapperV.h"
#import <Masonry/Masonry.h>
#import "BZUCInputVModel.h"
#import "BZUCInputV.h"
#import <BZPreHeaderComponent/BZPreHeaderComponent.h>

@interface BZUCForgetVC ()


@property (nonatomic,weak) BZUCForgetWrapperV *forgetWrapperV;

@end

@implementation BZUCForgetVC

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    BZUCForgetWrapperV *forgetWrapperV = [[BZUCForgetWrapperV alloc]init];
    forgetWrapperV.backgroundColor = [UIColor whiteColor];
    forgetWrapperV.contentSize = CGSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT-64);
    [self.view addSubview:forgetWrapperV];
    self.forgetWrapperV = forgetWrapperV;
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    [forgetWrapperV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.view);
        make.right.equalTo(self.view);
        make.bottom.equalTo(self.view);
        make.top.equalTo(self.view).with.offset(64);
    }];
    
    NSArray *strArr = @[@"输入手机号码",@"请输入验证码",@"请输入新密码,密码6~20位字符",@"请再次输入新密码"];
    
    NSMutableArray *arr = [NSMutableArray arrayWithCapacity:4];
    
    for (NSUInteger i = 0; i < 4; i++) {
        BZUCInputVModel *model = [[BZUCInputVModel alloc]init];
        model.iconVWidth = 0;
        model.placeholderText = strArr[i];
        model.placeholderColor = [UIColor colorWithRed:0.64 green:0.51 blue:0.43 alpha:1.00];
        model.placeholderFont = [UIFont systemFontOfSize:15];
        if (i == 1) {
            model.timerBtnW = 72;
            model.textLimit = 6;
            model.keyboardType = UIKeyboardTypeNumberPad;
        }else if (i == 0){
            model.textLimit = 11;
            model.keyboardType = UIKeyboardTypeNumberPad;
            
        }else{
            model.keyboardType = UIKeyboardTypeDefault;
            model.textLimit = 20;
        }
        [arr addObject:model];
    }
    forgetWrapperV.viewData = [arr copy];

    BZUCInputV *accountV = [forgetWrapperV.forgetV.inputArr objectAtIndex:0];
    accountV.textF.text = self.accountText;

}



- (void)viewWillDisappear:(BOOL)animated{

    
    [super viewWillDisappear:animated];
    BZUCInputV *accountV = [self.forgetWrapperV.forgetV.inputArr objectAtIndex:0];
    self.accountBlock(accountV.textF.text);
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
